const request = require('./request')
const BASE_URL = '/finance/bill'
/**
 * 账单相关接口
 */
const financeBill = {
  /**
   * 获取账单初始化参数
   * @returns {Promise}
   */
  billInitParam() {
    return request.get(BASE_URL + '/init')
  },

  /**
   * 获取账单列表
   * @param {Object} params 查询参数
   * @returns {Promise}
   */
  getBillList(params = {}) {
    return request.get(BASE_URL + '/list', params)
  },

  /**
   * 分页获取账单记录列表
   * @param {Object} params 查询参数
   * @returns {Promise}
   */
  getBillRecordList(params = {}) {
    return request.get(BASE_URL + '/record/page/list', params)
  },

  /**
   * 获取年度账单记录
   * @param {Object} params 查询参数
   * @returns {Promise}
   */
  getYearlyBillRecords(params = {}) {
    return request.get(BASE_URL + '/yearly/record/page/list', params)
  },

  /**
   * 获取月度账单记录
   * @param {Object} params 查询参数
   * @returns {Promise}
   */
  getMonthlyBillRecords(params = {}) {
    return request.get(BASE_URL + '/monthly/record/page/list', params)
  },

  /**
   * 分页获取未出账记录
   * @param {Object} params 查询参数
   * @returns {Promise}
   */
  getPendingBillRecords(params = {}) {
    return request.get(BASE_URL + '/pending/record/page/list', params)
  },

  /**
   * 分页月度统计数据
   * @param {Object} params 查询参数
   * @returns {Promise}
   */
  getMonthStatistics(params = {}) {
    return request.get(BASE_URL + '/statistics/month', params)
  }
}

module.exports = financeBill 